package com.hejielife.readwritelock1;

/**
 * 2019年8月2日 下午3:12:23
 * 
 * @author hejielife
 * @despribe ReaderThread
 */

public class ReaderThread extends Thread {
	private final Data data;

	public ReaderThread(Data data) {
		this.data = data;
	}

	public void run() {
		try {
			while (true) {
				char[] readbuf = data.read();
				System.out.println(Thread.currentThread().getName() + " reads " + String.valueOf(readbuf));
			}
		} catch (InterruptedException e) {
		}
	}
}
